<#include "../_inc/_layout.html"/> 
<#include "_option_script.html"/> 
<@layout active_id=p child_active_id=c>
<section class="content-header">
	<h1>通知设置</h1>
</section>

<!-- Main content -->
<section class="content">
	<p class="content-msg">
		通过通知设置功能，可以让用户或管理员及时了解网站内容的动态和变化。
	</p>
	
	<form action="${CPATH}/admin/option/save" method="POST" id="form">
	
		<input type="hidden" name="ucode" value="${ucode}">
		<input type="hidden" name="autosave" value="email_host,email_username,email_password,email_usessl,sms_host,sms_app_secret,sms_app_key,notify_author_by_email_when_has_comment,notify_author_by_sms_when_has_comment,notify_author_by_wechat_when_has_comment,notify_admin_by_email_when_user_registed,notify_admin_by_sms_when_user_registed,notify_admin_by_wechat_when_user_registed">

		<div class="row">
			<div class="col-xs-12">
			<h4 class="jp-set-title">邮件服务器</h4>
			<ul class="list-unstyled">
				<li class="jp-set-pad">
					<div class="col-sm-3 col-jpress">
						<div class="  jp-set-info ">
							 SMTP服务器地址
						</div>
					</div>
					<div class="col-sm-9  jp-set-title-line">
						<div class="col-sm-6 jp-table-distance-top ">
							<input class="form-control input-md" type="text" name="email_host" value="${OPTION('email_host')!}" >
							请填写邮箱的SMTP服务器。例如：smtp.qq.com (QQ邮箱)，smtp.163.com (网易邮箱)。
						</div>
					</div>
					<div class="clr"></div>
				</li>
				
				<li class="jp-set-pad">
					<div class="col-sm-3 ">
						<div class="  jp-set-info ">
							用户名
						</div>
					</div>
					<div class="col-sm-9  jp-set-title-line">
						<div class="col-sm-6 jp-table-distance-top ">
							<input class="form-control input-md" type="text" name="email_username" value="${OPTION('email_username')!}" >
						</div>
					</div>
					<div class="clr"></div>
				</li>
				
				<li class="jp-set-pad">
					<div class="col-sm-3 ">
						<div class="  jp-set-info ">
							 账号密码
						</div>
					</div>
					<div class="col-sm-9  jp-set-title-line">
						<div class="col-sm-6 jp-table-distance-top ">
							<input class="form-control input-md" type="text" name="email_password" value="${OPTION('email_password')!}" >
						</div>
					</div>
					<div class="clr"></div>
				</li>
				
				<li class="jp-set-pad">
					<div class="col-sm-3 ">
						<div class="  jp-set-info ">
							 SSL
						</div>
					</div>
					<div class="col-sm-9  jp-set-title-line">
						<div class="col-sm-6 jp-table-distance-top ">
							<label><input class=" " type="checkbox"  name="email_usessl" value="true" ${OPTION_CHECKED('email_usessl')}  >  <span class="jp-set-info"> 使用SSL</span></label>
							<br />QQ邮箱，gmail邮箱，163邮箱等请开启。
						</div>
					</div>
					<div class="clr"></div>
				</li>
				
				
			</ul>
			</div>
			<!-- /.box -->
		</div>
		
		<div class="row">
			<div class="col-xs-12">
			<h4 class="jp-set-title">短信服务器</h4>
			<ul class="list-unstyled">
				<li class="jp-set-pad">
					<div class="col-sm-3 col-jpress">
						<div class="  jp-set-info ">
							 短信服务器
						</div>
					</div>
					<div class="col-sm-9  jp-set-title-line">
						<div class="col-sm-6 jp-table-distance-top ">
							<select name="sms_app_provider" class="form-control input-md">
								<option value="sms_provider_alidayu" >阿里大于</option>
							</select>
							暂时只支持阿里大于，后续会增加更多的短信服务器，阿里大于官网：<a href="http://www.alidayu.com" target="_blank">http://www.alidayu.com</a>。
						</div>
					</div>
					<div class="clr"></div>
				</li>
				
				<li class="jp-set-pad">
					<div class="col-sm-3 ">
						<div class="  jp-set-info ">
							App Key
						</div>
					</div>
					<div class="col-sm-9  jp-set-title-line">
						<div class="col-sm-6 jp-table-distance-top ">
							<input class="form-control input-md" type="text" name="sms_app_key" value="${OPTION('sms_app_key')!}" >
						</div>
					</div>
					<div class="clr"></div>
				</li>
				
				<li class="jp-set-pad">
					<div class="col-sm-3 ">
						<div class="  jp-set-info ">
							 App Secret
						</div>
					</div>
					<div class="col-sm-9  jp-set-title-line">
						<div class="col-sm-6 jp-table-distance-top ">
							<input class="form-control input-md" type="text" name="sms_app_secret" value="${OPTION('sms_app_secret')!}" >
						</div>
					</div>
					<div class="clr"></div>
				</li>
			</ul>
			</div>
		</div>
		<!-- /row -->
		
		<div class="row">
			<div class="col-xs-12">
			<h4 class="jp-set-title">作者通知</h4>
			<ul class="list-unstyled">
				
				<li class="jp-set-pad">
					<div class="col-sm-3 ">
						<div class="  jp-set-info ">当内容（比如文章）被评论时通知作者</div>
					</div>
					<div class="col-sm-9  jp-set-title-line">
						<div class="col-sm-6 jp-table-distance-top ">
							<div class="  jp-set-title-line">
								<label><input type="checkbox" value="true" name="notify_author_by_email_when_has_comment" ${OPTION_CHECKED('notify_author_by_email_when_has_comment')}> 开启邮件通知</label>
								<textarea rows="3" class="form-control input-md" name="notify_author_content_by_email_when_has_comment" placeholder="邮件通知内容">${OPTION('notify_author_content_by_email_when_has_comment')!}</textarea>
							</div>
								
							<div class=" jp-set-title-line">
								<label><input type="checkbox" value="true" name="notify_author_by_sms_when_has_comment" ${OPTION_CHECKED('notify_author_by_sms_when_has_comment')}> 开启短信通知 </label>
									<textarea rows="2" class="form-control input-md" name="notify_author_content_by_sms_when_has_comment" placeholder="短信通知内容">${OPTION('notify_author_content_by_sms_when_has_comment')!}</textarea>
								</div>
							<div class=" jp-set-title-line">
								<label><input type="checkbox" value="true" name="notify_author_by_wechat_when_has_comment" ${OPTION_CHECKED('notify_author_by_wechat_when_has_comment')}> 开启微信通知 </label>
								<textarea rows="2" class="form-control input-md" name="notify_author_content_by_wechat_when_has_comment" placeholder="微信通知内容">${OPTION('notify_author_content_by_wechat_when_has_comment')!}</textarea>
							</div>
						</div>
					</div>
					<div class="clr"></div>
				</li>
			</ul>
			</div>
		</div>
		
		
		<div class="row">
			<div class="col-xs-12">
			<h4 class="jp-set-title">回复通知</h4>
			<ul class="list-unstyled">
				
				<li class="jp-set-pad">
					<div class="col-sm-3 ">
						<div class="  jp-set-info ">当某条评论被回复时，通知评论人</div>
					</div>
					<div class="col-sm-9  jp-set-title-line">
						<div class="col-sm-6 jp-table-distance-top ">
							<div class="  jp-set-title-line">
								<label><input type="checkbox" value="true" name="notify_parent_author_by_email_when_has_comment" ${OPTION_CHECKED('notify_parent_author_by_email_when_has_comment')}> 开启邮件通知</label>
								<textarea rows="3" class="form-control input-md" name="notify_parent_author_content_by_email_when_has_comment" placeholder="邮件通知内容">${OPTION('notify_parent_author_content_by_email_when_has_comment')!}</textarea>
							</div>
								
							<div class=" jp-set-title-line">
								<label><input type="checkbox" value="true" name="notify_parent_author_by_sms_when_has_comment" ${OPTION_CHECKED('notify_parent_author_by_sms_when_has_comment')}> 开启短信通知 </label>
									<textarea rows="2" class="form-control input-md" name="notify_parent_author_content_by_sms_when_has_comment" placeholder="短信通知内容">${OPTION('notify_parent_author_content_by_sms_when_has_comment')!}</textarea>
								</div>
							<div class=" jp-set-title-line">
								<label><input type="checkbox" value="true" name="notify_parent_author_by_wechat_when_has_comment" ${OPTION_CHECKED('notify_parent_author_by_wechat_when_has_comment')}> 开启微信通知 </label>
								<textarea rows="2" class="form-control input-md" name="notify_parent_author_content_by_wechat_when_has_comment" placeholder="微信通知内容">${OPTION('notify_parent_author_content_by_wechat_when_has_comment')!}</textarea>
							</div>
						</div>
					</div>
					<div class="clr"></div>
				</li>
			</ul>
			</div>
		</div>
		
		
		<div class="row">
			<div class="col-xs-12">
			<h4 class="jp-set-title">@通知</h4>
			<ul class="list-unstyled">
				
				<li class="jp-set-pad">
					<div class="col-sm-3 ">
						<div class="  jp-set-info ">当用户被@时，通知被@用户</div>
					</div>
					<div class="col-sm-9  jp-set-title-line">
						<div class="col-sm-6 jp-table-distance-top ">
							<div class="  jp-set-title-line">
								<label><input type="checkbox" value="true" name="notify_author_by_email_when_at" ${OPTION_CHECKED('notify_author_by_email_when_at')}> 开启邮件通知</label>
								<textarea rows="3" class="form-control input-md" name="notify_author_content_by_email_when_at" placeholder="邮件通知内容">${OPTION('notify_author_content_by_email_when_at')!}</textarea>
							</div>
								
							<div class=" jp-set-title-line">
								<label><input type="checkbox" value="true" name="notify_author_by_sms_when_at" ${OPTION_CHECKED('notify_author_by_sms_when_at')}> 开启短信通知 </label>
									<textarea rows="2" class="form-control input-md" name="notify_author_content_by_sms_when_at" placeholder="短信通知内容">${OPTION('notify_author_content_by_sms_when_at')!}</textarea>
								</div>
							<div class=" jp-set-title-line">
								<label><input type="checkbox" value="true" name="notify_author_by_wechat_when_at" ${OPTION_CHECKED('notify_author_by_wechat_when_at')}> 开启微信通知 </label>
								<textarea rows="2" class="form-control input-md" name="notify_author_content_by_wechat_when_at" placeholder="微信通知内容">${OPTION('notify_author_content_by_wechat_when_at')!}</textarea>
							</div>
						</div>
					</div>
					<div class="clr"></div>
				</li>
			</ul>
			</div>
		</div>
		
		<div class="row">
			<div class="col-xs-12">
			<h4 class="jp-set-pad jp-set-title">管理员通知</h4>
			<p >
				此项设置之前，请先确保在 <a href="${CPATH}/admin/option/web?p=option&c=web">管理员信息配置页面</a> 正确填写了管理的信息。
			</p>
			<ul class="list-unstyled">
				
				<li class="jp-set-pad">
					<div class="col-sm-3 ">
						<div class="  jp-set-info ">当用户注册时</div>
					</div>
					<div class="col-sm-9  jp-set-title-line">
						<div class="col-sm-6 jp-table-distance-top ">
							<div class="jp-set-title-line">
								<label><input type="checkbox" value="true" name="notify_admin_by_email_when_user_registed" ${OPTION_CHECKED('notify_admin_by_email_when_user_registed')}> 开启邮件通知</label>
								<textarea rows="3" class="form-control input-md" name="notify_admin_by_content_email_when_user_registed" placeholder="邮件通知内容">${OPTION('notify_admin_by_content_email_when_user_registed')!}</textarea>
							</div>
								
							<div class="jp-set-title-line">
								<label><input type="checkbox" value="true" name="notify_admin_by_sms_when_user_registed" ${OPTION_CHECKED('notify_admin_by_sms_when_user_registed')}> 开启短信通知 </label>
									<textarea rows="2" class="form-control input-md" name="notify_admin_content_by_sms_when_user_registed" placeholder="短信通知内容">${OPTION('notify_admin_content_by_sms_when_user_registed')!}</textarea>
								</div>
							<div class="jp-set-title-line">
								<label><input type="checkbox" value="true" name="notify_admin_by_wechat_when_user_registed" ${OPTION_CHECKED('notify_admin_by_wechat_when_user_registed')}> 开启微信通知 </label>
								<textarea rows="2" class="form-control input-md" name="notify_admin_content_by_wechat_when_user_registed" placeholder="微信通知内容">${OPTION('notify_admin_content_by_wechat_when_user_registed')!}</textarea>
							</div>
						</div>
					</div>
					<div class="clr"></div>
				</li>
			</ul>
			</div>
		</div>
		
		
		<div class="row">
		<div class="col-xs-12">
			<button type="button" onclick="doSubmit()" class="btn btn-primary">保存更改</button>
		</div>
		</div>
	<!-- /.row -->
	</form>
</section>
<!-- /.content -->

</@layout>
